package com.mzz.structure.proxy.proxyaop;

import java.lang.reflect.Proxy;

/**
 *
 * @author xushijian
 * @date 18/6/5 上午10:53
 */
public class Test {

    public static void main(String[] args) {

        CalculatorHandler calculatorHandle = new CalculatorHandler(new CalculatorImpl());

        Calculator proxy = (Calculator) Proxy.newProxyInstance(Calculator.class.getClassLoader(), new Class[]{Calculator.class}, calculatorHandle);

        System.out.println(proxy.calculate(10, 2));
    }
}
